<?php

	class My{
		
		function __get($k){
			if(isset($this->$k)) return $this->$k;	
		}
		
		function get($k){
			return $this->__get($k);	
		}
		
		function put($k, $v){
			if(in_array($k, array('db', 'my', 'this', 'caller', 'document', 'post', 'get', 'server'))) return;
			$this->$k = $v;
		}
		
		function __isset($k){
			if(isset($this->$k)) return true;	
			switch($k){
				case 'db':
					$this->db = db();
					return true;
				case 'my':
					$this->my = db()->package('Nicename');
					return true;
				case 'this':
				case 'caller':
				case 'document':
					$this->$k = document();
					return true;
				case 'post':
					$this->$k = object($_POST)->objectify();
					return true;
				case 'get':
					$this->$k = object($_GET)->objectify();
					return true;
				case 'server':
					$this->$k = object($_SERVER)->objectify();
					return true;
			}
			return false;
		}
	}	

